﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using HttpConnection.Interfaces;

namespace HttpConnection
{
    public class HttpWebConnection : IHttp
    {
        public string Url { get; protected set; }

        public HttpWebConnection(string url)
        {
            this.Url = url;
        }

        public string Receive()
        {
            WebRequest request = WebRequest.Create(Url);
            WebResponse response = request.GetResponse();

            Stream stream = response.GetResponseStream();
            StreamReader reader = new StreamReader(stream);
            string content = reader.ReadToEnd();

            return content;
        }

        public bool IsConnected
        {
            get { throw new NotImplementedException(); }
        }

        public int TimeOut
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public void Open(string url, int port)
        {
            throw new NotImplementedException();
        }

        public void Close()
        {
            throw new NotImplementedException();
        }

        public void Send(string command)
        {
            throw new NotImplementedException();
        }

        public Stream GetStream()
        {
            throw new NotImplementedException();
        }

        public string ConnectionTest(string url, int port)
        {
            throw new NotImplementedException();
        }
    }
}
